#-*- coding: utf-8 -*-

# 以下是比較不好的寫法
line = 5
for i in range( 0, line, 1 ):
	for j in range( 0, line - i, 1 ):
		print " ",
	
	for k in range( 0, (2*i)-1, 1 ):
		print "*",
	print ""

print ""

# ========================================= 
# 印出一個菱形

totalLine = 5	# 控制行數
spaceNum  = 4	# 控制空白
starNum   = 1	# 控制星星

# 最外層迴圈控制行數
for i in range( 0, totalLine, 1 ):
	
	# 先印出空白
	for j in range( 0, spaceNum, 1 ):
		print " ",
	
	# 再印出星星
	for k in range( 0, starNum, 1 ):
		print "*",
		
	spaceNum -= 1	# 每一行空白少印一個
	starNum  += 2	# 每一行星星多印兩個
	print ""
	
invertedTotalLine = 4
invertedSpaceNum  = 1
invertedStarNum   = 7

for i in range( 0, invertedTotalLine ):
	
	for j in range( 0, invertedSpaceNum ):
		print " ",
		
	for k in range( 0, invertedStarNum ):
		print "*",
		
	invertedSpaceNum += 1
	invertedStarNum  -= 2
	print ""